package com.huaixia18.systemnotice.controller;

import com.huaixia18.systemnotice.domain.EventRemind;
import com.huaixia18.systemnotice.service.EventRemindService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/event-remind")
public class EventRemindController {

    @Autowired
    private EventRemindService eventRemindService;

    // 处理事件提醒接口
    @PostMapping("/handle")
    public void handleEventRemind(@RequestBody EventRemind remind) {
        eventRemindService.handleEventRemind(remind);
    }

    // 聚合事件提醒接口
    @GetMapping("/aggregate/{recipientId}")
    public Map<String, List<EventRemind>> aggregateEventReminds(@PathVariable Long recipientId) {
        return eventRemindService.aggregateEventReminds(recipientId);
    }
}
